import {BasicColumn, FormSchema} from '/@/components/Table';
import {render} from '/@/utils/common/renderUtils';

export enum ConfigPageType {
  JSON = '1',
  CUSTOM = '2'
}


export const columns: BasicColumn[] = [
  {
    title: '支付方式代码',
    width: 100,
    dataIndex: 'wayCode'
  },
  {
    title: '支付方式名称',
    width: 100,
    dataIndex: 'wayName',
  },
  {
    dataIndex: 'status', 
    title: '状态',
    width: 40,
    customRender: ({text}) => {
      let color = "green"
      if (text == '0') color = '#FFCC33'
      if (text == '1') color = 'green'
      
      return render.renderTag(render.renderDict(text, 'data_use_status'), color)
    },
  }
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'wayCode',
    label: '支付方式代码',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    field: 'wayName',
    label: '支付方式名称',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: '状态',
    field: 'status',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode:'data_use_status',
      placeholder:'请选择状态'
    }
  },
];


export const formSchema: FormSchema[] = [
  {
    field: 'id',
    label: '通道id',
    show: false,
    component: 'Input'
  },
  
  {
    field: 'status',
    label: '状态',
    component: 'JDictSelectTag',
    defaultValue: "0",
    componentProps: {
      dictCode:'data_use_status',
      type:'radio'
    }
  },
  {
    field: 'riskConfig',
    label: '风控数据',
    component: 'InputTextArea',
  },
  {
    field: 'rate',
    label: '支付方式费率',
    required: true,
    defaultValue: 0,
    helpMessage: '单位是%',
    component: 'Input',
  },
  {
    field: 'remark',
    label: '备注',
    componentProps: {
      
    },
    component: 'InputTextArea',
    colProps: {
      style: 'color: red',
      sm: 24, // ≥576px
    }
  },
  
]

